let CommonModule = {
    providers:['CommonService'],
    exports:['CommonService']
}
let OuterModule = {
    providers:['OuterService'],
    exports:['OuterService']
}
let appModule = {
    imports:[
        CommonModule,
        OuterModule
    ]
}

interface CommonService{log:any}
// Outer 使用了Common的
class OuterService{
    constructor(private CommonService:CommonService) {
    }
    log(message: string) {
        this.CommonService.log("OuterService.CommonService");
        console.log('OuterService.log:',message);
    }
}

// App controller使用了 Outer 的provider的log能否访问到其内部调用的Common的方法
// 设计上是不允许的，每个模块都是隔离的
class AppController{
    constructor(private OuterService:OuterService) {
        this.OuterService.log('AppController.OuterService')
    }
}


class providerFactory {}
let providerInstances = {
    'provideToken1': new providerFactory(),
    'provideToken2': new providerFactory(),
}
let moduleProviders = {
    'new providerFactory()':[
        'provideToken1'
    ]
}
